#define  _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int cmp_int(const void* p1, const void* p2)
{
	return *(int*)p1 - *(int*)p2;
}
int cmp_char(const void* p1, const void* p2)
{
	return *(char*)p1 - *(char*)p2;
}
void print(int* x, int s)
{
	for (int i = 0; i < s; i++)
	{
		printf("%d ", x[i]);
	}
	printf("\n");
}
struct Stu
{
	char name[20];
	int age;
};
int cmp_stu_by_name(const void* p1, const void* p2)
{
	return strcmp(((struct Stu*)p1)->name, ((struct Stu*)p2)->name);
}
int main()
{
	int a[] = {3, 5, 7, 9, 4, 6, 1, 0, 2, 8};
	char b[] = { "bdefacgih" };
	struct Stu s[] = { {"zhangsan",30},{"lisi",25},{"wangwu",50} };

	int s1 = sizeof(a) / sizeof(a[0]);
	int s2 = strlen(b);
	int s3 = sizeof(s) / sizeof(s[0]);

	qsort(a, s1 , sizeof(a[0]), cmp_int);
	qsort(b, s2 , sizeof(b[0]), cmp_char);
	qsort(s, s3, sizeof(s[0]), cmp_stu_by_name);
	
	print(a, s1);
	printf("%s",b);


	return 0;
}